Method for protecting an electronic device driven by dc motor and circuit for detecting positioning signals thereof

ABSTRACT

A method for protecting an electronic apparatus driven by a DC motor and a detection circuit for detecting positioning signals thereof. The electronic device includes an optical encoder, a code strip, and a DC motor. While moves along the code strip, the optical encoder outputs a first positioning signal and a second positioning signal for the control of the DC motor. The method includes the steps described below. First, states of the first and second positioning signals are detected. If the states of the first and second positioning signals are normal, the DC motor is controlled according to the first and second positioning signals. If the first positioning signal or the second positioning signal is abnormal, a preventive method is performed.

This application claims the benefit of Taiwan application Ser. No.93135911, filed Nov. 22, 2004, the subject matter of which isincorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The invention relates in general to a protection method for anelectronic device and a circuit for detecting positioning signalsthereof, and more particularly to a protection method for an electronicdevice driven by a DC motor and a circuit for detecting positioningsignals thereof.

2. Description of the Related Art

DC motors have been widely employed in various electronic productsbecause motor speeds are adjustable easily and can generate a largetorque. The electronic devices driven by DC motors such as printersgenerally utilize optical encoders in company with code strips togenerate corresponding signals for the sake of controlling devices.

FIG. 1A shows a portion of a conventional printer. The printer includesa DC motor 110, a control unit (not shown), a print head 120, an opticalencoder 130, and a code strip 140. Printing process is performed throughthe print head 120 driven by the DC motor 110 under the control of thecontrol unit.

When the actuating DC motor 110 drives the print head 120, the opticalencoder 130 disposed inside the print head 120 moves along the codestrip 140, generating positioning signals A and B. For example, when theoptical encoder 130 moves towards the direction pointed to by an arrow10 under normal situation, the positioning signal A leads thepositioning signal B, as shown in FIG. 1B. Conversely, when the opticalencoder 130 moves towards the direction pointed to by an arrow 20 undernormal situation, the positioning signal B leads the positioning signalA, as shown in FIG. 1C. The control unit controls the DC motor 110 bydetermining, according to the relationships between the positioningsignals A and B, the direction and the distance the print head 120 ismoving.

In order to avoid unexpected destructive operations of the DC motor, thecontrol units of some electronic devices with DC motors, conventionally,would include additional protection methods. Currently, most of theprotection methods determine whether the devices are in normal stateaccording to variation of a position value which is generated by thecontrol unit after the control unit processes the positioning signals Aand B. Since these protection methods only work when the position valuedoes not vary, such protection methods can only avoid abnormalsituations due to the failure of generating signals from the opticalencoder caused by the dropping of the code strip or the malfunctioningof the optical encoder. When any other situations happen where thepositioning signals abnormally generated from the optical encoder, theDC motors would lose control and operates destructively, thus causingunexpected damages to the devices.

SUMMARY OF THE INVENTION

It is therefore an object of the invention to provide a protectionmethod for an electronic device driven by a DC motor and a circuit fordetecting the positioning signals thereof so that the electronic deviceis protected from unexpected damage by avoiding destructive operationsof the DC motor due to the positioning signals generated abnormally.

The invention achieves the above-identified object by providing adetection circuit for detecting states of a first positioning signal anda second positioning signal. The detection circuit includes a risingedge detection device, a first falling edge detection device, and acomparator. The rising edge detection device is used for receiving thefirst and second positioning signals and outputting a first controlsignal, wherein when detecting a rising edge of the second positioningsignal, the rising edge detection device outputs the first positioningsignal as the first control signal. The first falling edge detectiondevice is employed to receive the first and second positioning signalsand output a second control signal, wherein when detecting a fallingedge of the second positioning signal, the first falling edge detectiondevice outputs the first positioning signal as the second controlsignal. The comparator is utilized for generating a status signalaccording to the first and second control signals. The status signalindicates that the first and second positioning signals are in normalstates when the first and second control signals are out of phase. Thestatus signal indicates that the first and second positioning signalsare in abnormal states when the first and second control signals are inphase.

In addition, the invention achieves the above-identified object byproviding a method for protecting an electronic apparatus including anencoder, a code strip, and a DC motor. While moving along the codestrip, the encoder generates a first positioning signal and a secondpositioning signal for control of the DC motor. The method includes thefollowing steps. First, a determination as to whether the states of thefirst and second positioning signals are normal is made by detecting thestates of the first and second positioning signals. If the detectedstates of the first and second positioning signals are normal, the DCmotor is controlled according to the first and second positioningsignals. If the detected state of the first positioning signal or secondpositioning signal is abnormal, a preventive method is performed.

Other objects, features, and advantages of the invention will becomeapparent from the following detailed description of the preferred butnon-limiting embodiments. The following description is made withreference to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A (Related Art) shows a portion of a conventional printer.

FIG. 1B (Related Art) illustrates positioning signals A and B generatedduring the movement of an encoder towards the direction directed byarrow 10, as shown in FIG. 1A.

FIG. 1C (Related Art) illustrates positioning signals A and B generatedduring the movement of an encoder towards the direction directed by thearrow 10 shown in FIG. 1A.

FIG. 2 is a flowchart illustrating a protection method according to apreferred embodiment of the invention.

FIG. 3 is a schematic diagram showing a detection circuit according tothe preferred embodiment of the invention.

FIG. 4 is a timing diagram showing the detection of the positioningsignals A and B in normal states by using the detection circuit shown inFIG. 3.

FIG. 5 is a timing diagram showing the detection of the positioningsignal A in an abnormal state by using the detection circuit shown inFIG. 3.

FIG. 6 is a timing diagram showing the detection of the positioningsignal A in another abnormal state by using the detection circuit shownin FIG. 3.

FIG. 7 is a timing diagram showing the detection of the positioningsignal B in an abnormal state by using the detection circuit shown inFIG. 3.

FIG. 8 is a timing diagram showing the detection of the positioningsignal B in another abnormal state by using the detection circuit shownin FIG. 3.

FIG. 9 is a timing diagram showing the detection of the positioningsignals A and B in abnormal states by using the detection circuit shownin FIG. 3.

FIG. 10 is a schematic diagram showing another detection circuitaccording to the preferred embodiment of the invention.

DETAILED DESCRIPTION OF THE INVENTION

Referring to FIG. 2, a protection method according to a preferredembodiment of the invention is shown in flowchart form. The protectionmethod is used for protecting an electronic apparatus driven by a DCmotor. The electronic apparatus, for example a printer, includes adetection circuit, preferably, in addition to an encoder, a code strip,and a DC motor. The protection method starts when the encoder movesalong the code strip and generates a positioning signal A and apositioning signal B for control of the DC motor.

First, the detection circuit generates a status signal to a control unitaccording to the positioning signals A and B, as indicated in step 210.The generation of the status signal by the detection circuit will beexplained later. Next, the control unit determines whether the states ofthe positioning signals A and B are normal according to the signal levelof the status signal, as indicated by step 220. If the states of thepositioning signals A and B are normal, the control unit controls the DCmotor according to the positioning signals A and B, as in step 230. Ifthe state of the positioning signal A or B is abnormal, the control unitperforms a preventive method, as indicated in step 240. The preventivemethod, for example, is to reduce the speed of the DC motor or reducethe speed of the DC motor to zero, i.e. terminates the operation of theDC motor.

As above mentioned, the preventive method of the protection methodaccording to the embodiment of the invention is performed if either thestate of the positioning signal A or B is abnormal, whereby preventingthe DC motor from operating destructively and damaging the electronicapparatus unexpectedly. The protection method according to theembodiment of the invention protects the electronic apparatuseffectively from various abnormal situations, not only the ones wherethe encoder fails to. generate signals due to the dropping off of thecode strip or damage of the encoder, but also the ones where the encodergenerates positioning signals in abnormal states due to other causes,such as the loosening of the code strip or shifting of the code strip.

The following explains the operations of how the detection circuitgenerates a status signal according to the positioning signals A and Baccording to the embodiment of the invention. Accordingly, the controlunit can determine whether the states of the positioning signals A and Bare normal according to the signal level of the status signal and candetermine whether to perform the prevention method.

Referring to FIG. 3, a detection circuit according to the preferredembodiment of the invention is shown. The detection circuit 300 is usedfor detecting the states of the positioning signals A and B so as todetermine whether the states of them are normal and to output a statussignal CS1 accordingly. The states of both the positioning signals A andB are defined as being normal in the embodiment if the positioningsignal A lags behind the positioning signal B, as the relationshipbetween the positioning signals A and B shown in FIG. 1C.

The detection circuit 300 includes a rising edge detection device FF1, afalling edge detection device FF2, and a comparator FA1. The rising edgedetection device FF1 is used for receiving positioning signals A and Band generating a control signal C1, wherein when detecting a rising edgeof the positioning signal B, the rising edge detection device FF1outputs the positioning signal A as the control signal C1. The fallingedge detection device FF2 is used for receiving the positioning signalsA and B and generating a control signal C2, wherein when detecting afalling edge of the positioning signal B, the falling edge detectiondevice FF2 outputs the positioning signal A as the control signal C2.The rising edge detection device FF1 and falling edge detection deviceFF2 can be implemented by D-type flip-flops, for example. The comparatorFA1 is employed to receive the control signal C1 and control signal C2and output the status signal CS1 according to the control signal C1 andcontrol signal C2.

The comparator FA1 includes an AND gate AND1 and a falling edgedetection device FF3. The AND gate AND1 is used for outputting a controlsignal C3 according to the control signal C2 and a reversed-phase signalof the control signal C1. The falling edge detection device FF3, forexample, a D-type flip-flop, is employed to receive the control signalC3 and the positioning signal B and to output the status signal CS1,wherein when detecting a falling edge of the positioning signal B, thefalling edge detection device FF3 outputs the control signal C3 as thestatus signal CS1.

The following explains the generation of the signal levels of the statussignal CS1 by the detection circuit 300 according to the positioningsignals A and B in various states. Referring to FIG. 4, a timing diagramshows the detection of the positioning signals A and B in normal statesby using the detection circuit shown in FIG. 3. When the detectioncircuit 300 detects the positioning signals A and B in normal states,the rising edge detection device FF1 is firstly triggered at the firstrising edge of the positioning signal B, i.e. time m, and outputs thepositioning signal A as the control signal C1, where the positioningsignal is at a low level, or in a logic “0” or de-asserted state, atthis time. Next, the falling edge detection device FF2 is triggered atthe first falling edge of the positioning signal B, i.e. time n, andoutputs the positioning signal A as the control signal C2, where thepositioning signal A is at a high level, or a logic “1” or assertedstate, at this time. After that, the AND gate AND1 outputs the controlsignal C3 after a delay time D according to the control signal C2 andthe reversed-phase signal of the control signal C1, i.e. the invertedversion of the control signal C1. Since the control signal C1 is at thelow level and the control signal C2 is at the high level, i.e. thecontrol signal C1 and control signal C2 being out of phase, both thecontrol signal C2 and the reversed-phase signal of the control signal C1are at the high level and the control signal C3 outputted by the ANDgate AND1 is at the high level. The falling edge detection device FF3 isthen triggered at the second falling edge of the positioning signal B,i.e. time p, and outputs the control signal C3, which is at the highlevel at this time, as the status signal CS1.

The generation of the signal levels of the status signal CS1 by thedetection circuit 300 in detecting positioning signals A and B inabnormal states is explained. Referring to FIGS. 3 and 5, FIG. 5 is atiming diagram showing the detection of the positioning signal A in anabnormal state by using the detection circuit shown in FIG. 3. In FIG.5, the positioning signal A remains at the low level. As can be seenfrom FIGS. 3 and 5, although the positioning signal B is in a normalstate, since the positioning signal A remains at the low level, thecontrol signal C1 outputted by the rising edge detection device FF1triggered at the time m and the control signal C2 outputted by thefalling edge detection device FF2 triggered at the time n are both atthe low level. The AND gate AND1 then outputs the control signal C3 atthe low level. Therefore, when triggered at the time p, the falling edgedetection device FF3 outputs the status signal CS1 at the low level

Referring to FIG. 6, a timing diagram showing the detection of thepositioning signal A in another abnormal state by using the detectioncircuit shown in FIG. 3 is shown. In FIG. 6, the positioning signal Aremains at the high level. As can be seen from FIGS. 3 and 6, althoughthe positioning signal B is in a normal state, since the positioningsignal A remains at the high level, both the control signal C1 outputtedby the rising edge detection device FF1 triggered at the time m and thecontrol signal C2 outputted by the falling edge detection device FF2triggered at the time n are at the high level. As such, the AND gateAND1 outputs the control signal C3 at the low level. Therefore, whentriggered at the time p, the falling edge detection device FF3 outputsthe status signal CS1 at the low level.

Regarding to the detection of the positioning signal B in differentabnormal states by using the detection circuit in FIG. 3, explanation isgiven along with timing diagrams in FIGS. 7 and 8. Further, FIG. 9 showsa timing diagram for the detection of the positioning signals A and Bboth in abnormal states by using the detection circuit in FIG. 3.

Since the detection circuit 300 is edge-triggered according to theembodiment, the flip-flops of the detection circuit 300 cannot betriggered when the positioning signal B is in an abnormal state,regardless of whether the positioning signal B remains at the low level,as shown in FIG. 7 or 9, or at the high level, as shown in FIG. 8.Hence, the status signal CS1 in either of FIG. 7, 8, or 9 is at the lowlevel.

According to the above explanations, the detection circuit 300 outputsthe status signal CS1 at the high level only if both the states of thepositioning signals A and B are normal. Conversely, the detectioncircuit 300 outputs the status signal CS1 at the low level if either ofthe states of the positioning signal A and B is abnormal, or if both ofthem are abnormal. Thus, the control unit can determine whether theelectronic apparatus is normal according to the status signal CS1directly.

Further, it should be noted that the control unit might make adetermination with a wrong result according to a status signal CS1 bythe detection circuit 300 when the status signal CS1 varies at itsinitial state. In order to obtain a correct result from thedetermination, it is preferably for the control unit to read the statussignal CS1 after a particular delay time elapses. For example, thecontrol unit can be implemented to read the status signal CS1 after thetime p and then determines whether the electronic apparatus is normalaccording to the status signal CS1 received after the time p. By doingso, a correct result from the determination of states of the electronicapparatus can be obtained.

Moreover, the detection circuit can be implemented with different designapproaches where according to the invention, a status signal isgenerated according to the positioning signals A and B so that thecontrol unit can determine whether the states of the positioning signalsA and B are normal according to the status signal directly and candetermine whether to perform a preventive method. For example, anotherdetection circuit according to the preferred embodiment of the inventionis shown in FIG. 10.

As shown in FIG. 10, the detection circuit 1000 includes a rising edgedetection device FF11, a falling edge detection device FF22, and acomparator FA2. As compared to the detection circuit 300 in FIG. 3, thecomparator FA2 of the detection circuit 1000 in FIG. 10 includes a timedelay device FF33 for delaying the detection, in addition to an AND gateAND2 and a falling edge detection device FF44, in order to make thedetection correctly. The time delay device FF33 can be a J-K flip-flop,for example, having two input terminals for receiving a high levelsignal, or a logic “1” or an asserted signal. During a falling edge ofthe positioning signal B, the J-K flip-flop FF33 outputs a controlsignal C33. The falling edge detection device FF44 is used for receivinga control signal C44 from the AND gate AND2 and the control signal C33and outputting a status signal CS2, wherein when detecting a fallingedge of the control signal C33, the falling edge detection device FF44outputs the control signal C44 as the status signal CS2.

According to the embodiments of the invention, the protection method foran electronic apparatus driven by a DC motor and a detection circuit fordetecting the positioning signals thereof are disclosed. Accordingly,the electronic apparatus is protected from unexpected damage by avoidingdestructive operations of the DC motor due to the positioning signalsgenerated abnormally.

While the invention has been described by way of example and in terms ofa preferred embodiment, it is to be understood that the invention is notlimited thereto. On the contrary, it is intended to cover variousmodifications and similar arrangements and procedures, and the scope ofthe appended claims therefore should be accorded the broadestinterpretation so as to encompass all such modifications and similararrangements and procedures.

1. A detection circuit for detecting states of a first positioningsignal and a second positioning signal, the detection circuitcomprising: a rising edge detection device for receiving the first andsecond positioning signals and outputting a first control signal,wherein when detecting a rising edge of the second positioning signal,the rising edge detection device outputs the first positioning signal asthe first control signal; a first falling edge detection device forreceiving the first and second positioning signals and outputting asecond control signal, wherein when detecting a falling edge of thesecond positioning signal, the first falling edge detection deviceoutputs the first positioning signal as the second control signal; and acomparator for generating a status signal according to the first andsecond control signals; wherein the status signal indicates that thefirst and second positioning signals are in normal states when the firstand second control signals are out of phase; wherein the status signalindicates that the first and second positioning signals are in abnormalstates when the first and second control signals are in phase.
 2. Thedetection circuit according to claim 1, wherein the detection circuit isdisposed in an electronic apparatus including an encoder, a code strip,and a DC motor, wherein while moving along the code strip, the encodergenerates the first and second positioning signals for control of the DCmotor.
 3. The detection circuit according to claim 2, wherein theelectronic apparatus is a printer.
 4. The detection circuit according toclaim 1, wherein the first and second control signals are out of phasewhen the first positioning signal lags behind the second positioningsignal.
 5. The detection circuit according to claim 1, wherein therising edge detection device is a D-type flip-flop.
 6. The detectioncircuit according to claim 1, wherein the first falling edge detectiondevice is a D-type flip-flop.
 7. The detection circuit according toclaim 1, wherein the comparator comprises: an AND gate, for outputting athird control signal according to a reversed phase signal of the firstcontrol signal and the second control signal; and a second falling edgedetection device for receiving the third control signal and secondpositioning signal, wherein when detecting the falling edge of thesecond positioning signal, the second falling edge detection deviceoutputs the third control signal as the status signal.
 8. The detectioncircuit according to claim 7, wherein the second falling edge detectiondevice is a D-type flip-flop.
 9. The detection circuit according toclaim 1, wherein the comparator comprises: an AND gate, for outputting athird control signal according to a reversed phase signal of the firstcontrol signal and the second control signal; a J-K flip-flop having afirst input terminal and a second input terminal, the first and secondinput terminals being for receiving a high level signal, wherein the J-Kflip-flop is for outputting a fourth control signal when detecting thefalling edge of the second positioning signal; and a second falling edgedetection device for receiving the third and fourth control signals,wherein when detecting a falling edge of the fourth control signal, thesecond falling edge detection device outputs the third control signal asthe status signal.
 10. The detection circuit according to claim 9,wherein the second falling edge detection device is a D-type flip-flop.11. A method for protecting an electronic apparatus including anencoder, a code strip, and a DC motor, wherein while moving along thecode strip, the encoder generates a first positioning signal and asecond positioning signal for control of the DC motor, the methodcomprising: determining whether states of the first and secondpositioning signals are normal by detecting the states of the first andsecond positioning signals; controlling the DC motor according to thefirst and second positioning signals if the detected states of the firstand second positioning signals are normal; and performing a preventivemethod if the detected state of the first positioning signal or secondpositioning signal is abnormal.
 12. The method according to claim 11,further comprising: generating a status signal according to the firstand second positioning signals.
 13. The method according to claim 12,further comprising: determining whether the states of the first andsecond positioning signals are normal according to a signal level of thestatus signal.
 14. The method according to claim 11, wherein thepreventive method is to reduce a speed of the DC motor or reduce thespeed of the DC motor to zero.
 15. The method according to claim 11,wherein the electronic apparatus is a printer.